﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace dasBlog.Storage
{
    public static class MonikerClient
    {
        public static IList<T> Select<T>(this Moniker moniker, MonikerMatch match, QueryDescription query) where T : class, new()
        {
            return StorageBus.Current.Select<T>(moniker, match, query);
        }

        public static IList<T> SelectAll<T>(this Moniker moniker) where T : class, new()
        {
            return StorageBus.Current.Select<T>(moniker, MonikerMatch.Exact, null);
        }

        public static IList<PropertyAggregate> Aggregate(this Moniker moniker, MonikerMatch match, string propertyName)
        {
            return StorageBus.Current.Aggregate(moniker, match, propertyName);
        }

        public static T Get<T>(this Moniker itemId) where T : class, new()
        {
            return StorageBus.Current.Get<T>(itemId);
        }

        public static void Delete(this Moniker itemId)
        {
            StorageBus.Current.Delete(itemId);
        }

        public static Moniker Store<T>(this Moniker moniker, T item) where T : class, new()
        {
            return StorageBus.Current.Store<T>(moniker, item);
        }
    }
}
